<?php
namespace Core;

//Declare constantes
define('CORE_DIR',  		__Dir__ . '/../../Core/') ;
define('COMMONS_DIR',  		CORE_DIR .'CoreCommons/');
define('COMPONENTS_DIR',  	CORE_DIR .'CoreComponents/');
define('CONTRACTS_DIR',  	CORE_DIR .'CoreContracts/');
define('SERVICES_DIR',  	CORE_DIR .'CoreServices/');
define('DATASTORAGE_DIR',  	CORE_DIR .'Datastorage/');

//Commons references
require_once(COMMONS_DIR . 'parameters.class.php');
require_once(COMMONS_DIR . 'logger.class.php');
require_once(COMMONS_DIR . 'localization.class.php');
require_once(COMMONS_DIR . 'comlistener.class.php');
require_once(COMMONS_DIR . 'serviceresponse.class.php');
require_once(COMMONS_DIR . 'mail.class.php');

//Services facade reference
require_once(CORE_DIR . 'coreservice.class.php');

//Components included
require_once(COMPONENTS_DIR . 'AccountingManager/Accounts.php');
require_once(COMPONENTS_DIR . 'AccountingManager/Operations.php');
require_once(COMPONENTS_DIR . 'AccountingManager/Categories.php');
require_once(COMPONENTS_DIR . 'DocumentsManager/Documents.php');
require_once(COMPONENTS_DIR . 'TasksManager/Tasks.php');
require_once(COMPONENTS_DIR . 'UsersManager/Users.php');
require_once(COMPONENTS_DIR . 'ArticlesManager/Articles.php');
require_once(COMPONENTS_DIR . 'EventsManager/Events.php');
require_once(COMPONENTS_DIR . 'TchatsManager/Tchats.php');
require_once(COMPONENTS_DIR . 'LogisticManager/Materials.php');

//Commons tools references
require_once(COMMONS_DIR . 'logger.class.php');

//DataStorage required references
require_once(DATASTORAGE_DIR . 'session.class.php');
require_once(DATASTORAGE_DIR . 'Tools/managedump.class.php');
require_once(DATASTORAGE_DIR . 'Tools/resetmappings.class.php');

require_once __Dir__ . '/simpletest/autorun.php';
require_once __Dir__ . '/simpletest/show_passes.php';

\SimpleTest::prefer(new \ShowPasses());

define('USER_TEST_ID', 11);

//@todo : Drop database and create test database

/**
* Accounts module test suite
*/
class AccountsServicesTests extends \TestSuite
{
	
    public function __construct()  
	{
		//Create suite test
		$this->TestSuite('Accounts module test suite');
	}
}

/**
* Articles module test suite
*/
class ArticlesServicesTests extends \TestSuite
{
	
    public function __construct()  
	{
		//Create suite test
		$this->TestSuite('Articles module test suite');
	}
}

/**
* Documents module test suite
*/
class DocumentsServicesTests extends \TestSuite
{
	
    public function __construct()  
	{
		//Create suite test
		$this->TestSuite('Documents module test suite');
	}
}

/**
* Events module test suite
*/
class EventsServicesTests extends \TestSuite
{
	
    public function __construct()  
	{
		//Create suite test
		$this->TestSuite('Events module test suite');
	}
}

/**
* Helpers module test suite
*/
class HelpersServicesTests extends \TestSuite
{
	
    public function __construct()  
	{
		//Create suite test
		$this->TestSuite('Helpers module test suite');
	}
}

/**
* Logistic module test suite
*/
class LogisticServicesTests extends \TestSuite
{
	
    public function __construct()  
	{
		//Create suite test
		$this->TestSuite('Logistic module test suite');
	}
}

/**
* Tasks module test suite
*/
class TasksServicesTests extends \TestSuite
{
	
    public function __construct()  
	{
		//Create suite test
		$this->TestSuite('Tasks module test suite');
			
		//User component automatic tests
		$this->addFile('Services_Tests/TasksModule/addTask_test.php');
		$this->addFile('Services_Tests/TasksModule/getAllTasks_test.php');
		$this->addFile('Services_Tests/TasksModule/getTasks_test.php');
		$this->addFile('Services_Tests/TasksModule/updateTask_test.php');
		$this->addFile('Services_Tests/TasksModule/deleteTask_test.php');
	}
}

/**
* Tchat module test suite
*/
class TchatServicesTests extends \TestSuite
{
	
    public function __construct()  
	{
		//Create suite test
		$this->TestSuite('Tchat module test suite');
	}
}

/*
* Users module test suite
*/
class UsersServicesTests extends \TestSuite
{
	
    public function __construct()  
	{
		//Create suite test
		$this->TestSuite('Users module test suite');
			
		//User component automatic tests
		$this->addFile('Services_Tests/UsersModule/getUsers_test.php');
		$this->addFile('Services_Tests/UsersModule/authenticate_test.php');
		$this->addFile('Services_Tests/UsersModule/addUser_test.php');
		$this->addFile('Services_Tests/UsersModule/addNewUser_test.php');
		$this->addFile('Services_Tests/UsersModule/checkAuthorization_test.php');
		$this->addFile('Services_Tests/UsersModule/updateUserInformations_test.php');
		$this->addFile('Services_Tests/UsersModule/updateUserPassword_test.php');
		$this->addFile('Services_Tests/UsersModule/setUserAsOnline_test.php');
		$this->addFile('Services_Tests/UsersModule/setUserAsOffline_test.php');
		$this->addFile('Services_Tests/UsersModule/updateUser_test.php');
		$this->addFile('Services_Tests/UsersModule/attachAvatarOnAnUser_test.php');
		$this->addFile('Services_Tests/UsersModule/getUsersMemberMinimum_test.php');
		$this->addFile('Services_Tests/UsersModule/demandNewMember_test.php');
		$this->addFile('Services_Tests/UsersModule/sendContact_test.php');
		$this->addFile('Services_Tests/UsersModule/validUserEmail_test.php');
		$this->addFile('Services_Tests/UsersModule/getProfiles_test.php');
		$this->addFile('Services_Tests/UsersModule/deleteUser_test.php');
		$this->addFile('Services_Tests/UsersModule/resetUserPassword_test.php');
    }
}

/**
* Weather module test suite
*/
class WeatherServicesTests extends \TestSuite
{
	
    public function __construct()  
	{
		//Create suite test
		$this->TestSuite('Weather module test suite');
	}
}
?>

